package com.asj.house.controller;


import com.asj.house.client.HouseRoomClient;
import com.asj.house.client.HouseRoomMapClient;
import com.asj.house.returns.RespEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 房屋地图信息表 前端控制器
 * </p>
 *
 * @author asj
 * @since 2021-03-04
 */
@RestController
@RequestMapping("/house-room-map")
@Slf4j
@Api(value = "房源地图信息相关接口", tags = "房源地图信息相关接口")
public class HouseRoomMapController {

    @Resource
    private HouseRoomMapClient houseRoomMapClient;

    @GetMapping("/list")
    @ApiOperation(value = "房源地图经纬度信息列表")
    public RespEntity listHouseRoomMap() {
        RespEntity respEntity = houseRoomMapClient.listHouseRoomMap();
        return respEntity;
    }

    @GetMapping("/room")
    @ApiOperation(value = "房源地图信息")
    @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "roomId", value = "房源id", required = true)
    public RespEntity roomMap(@RequestParam(value = "roomId", required = true) Integer roomId) {
        RespEntity respEntity = houseRoomMapClient.getRoomMap(roomId);
        return respEntity;
    }

}
